// 版权归陈超所有


#include "Player/CC_PlayerState.h"

#include "AbilitySystem/CC_AbilitySystemComponent.h"
#include "AbilitySystem/CC_AttributeSet.h"

ACC_PlayerState::ACC_PlayerState()
{
	//添加能力系统组件
	AbilitySystemComponent = CreateDefaultSubobject<UCC_AbilitySystemComponent>("AbilitySystemComponent");
	AbilitySystemComponent->SetIsReplicated(true); //设置组件用于在网络上复制
	AbilitySystemComponent->SetReplicationMode(EGameplayEffectReplicationMode::Mixed);	//复制模式
	
	//添加属性集
	AttributeSet = CreateDefaultSubobject<UCC_AttributeSet>("AttributeSet");
	
	// NetUpdateFrequency = 100.f;
	// 'NetUpdateFrequency的公共访问已被弃用。请改用SetNetUpdateFrequency（）和GetNetUpdateFrequence（）。请在升级到下一版本之前将代码更新到新的API，否则您的项目将不再编译。'
	SetNetUpdateFrequency(100.f);	//设置网络复制频率
}

//重写接口函数，获取能力系统组件
UAbilitySystemComponent* ACC_PlayerState::GetAbilitySystemComponent() const
{
	return AbilitySystemComponent;
}

